package com.yida.gwj.deposit.service.impl;

import com.yida.common.core.utils.DateUtils;
import com.yida.common.security.utils.SecurityUtils;
import com.yida.gwj.deposit.domain.GwjDepositBusinessMoney;
import com.yida.gwj.deposit.mapper.GwjDepositBusinessMoneyMapper;
import com.yida.gwj.deposit.service.IGwjDepositBusinessMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务维修资金分户业务金额信息（缴存业务管理模块）Service业务层处理
 *
 * @author lqq
 * @date 2023-01-10
 */
@Service
public class GwjDepositBusinessMoneyServiceImpl implements IGwjDepositBusinessMoneyService {
	@Autowired
	private GwjDepositBusinessMoneyMapper gwjDepositBusinessMoneyMapper;

	/**
	 * 查询业务维修资金分户业务金额信息（缴存业务管理模块）
	 *
	 * @param bizMoneyId 业务维修资金分户业务金额信息（缴存业务管理模块）主键
	 * @return 业务维修资金分户业务金额信息（缴存业务管理模块）
	 */
	@Override
	public GwjDepositBusinessMoney selectGwjDepositBusinessMoneyByBizMoneyId(Long bizMoneyId) {
		return gwjDepositBusinessMoneyMapper.selectGwjDepositBusinessMoneyByBizMoneyId(bizMoneyId);
	}

	/**
	 * 查询业务维修资金分户业务金额信息（缴存业务管理模块）列表
	 *
	 * @param gwjDepositBusinessMoney 业务维修资金分户业务金额信息（缴存业务管理模块）
	 * @return 业务维修资金分户业务金额信息（缴存业务管理模块）
	 */
	@Override
	public List<GwjDepositBusinessMoney> selectGwjDepositBusinessMoneyList(GwjDepositBusinessMoney gwjDepositBusinessMoney) {
		return gwjDepositBusinessMoneyMapper.selectGwjDepositBusinessMoneyList(gwjDepositBusinessMoney);
	}

	/**
	 * 新增业务维修资金分户业务金额信息（缴存业务管理模块）
	 *
	 * @param gwjDepositBusinessMoney 业务维修资金分户业务金额信息（缴存业务管理模块）
	 * @return 结果
	 */
	@Override
	public int insertGwjDepositBusinessMoney(GwjDepositBusinessMoney gwjDepositBusinessMoney) {
		gwjDepositBusinessMoney.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getRealName());
		gwjDepositBusinessMoney.setCreateTime(DateUtils.getNowDate());
		return gwjDepositBusinessMoneyMapper.insertGwjDepositBusinessMoney(gwjDepositBusinessMoney);
	}

	/**
	 * 修改业务维修资金分户业务金额信息（缴存业务管理模块）
	 *
	 * @param gwjDepositBusinessMoney 业务维修资金分户业务金额信息（缴存业务管理模块）
	 * @return 结果
	 */
	@Override
	public int updateGwjDepositBusinessMoney(GwjDepositBusinessMoney gwjDepositBusinessMoney) {
		gwjDepositBusinessMoney.setUpdateBy(SecurityUtils.getLoginUser().getSysUser().getRealName());
		gwjDepositBusinessMoney.setUpdateTime(DateUtils.getNowDate());
		return gwjDepositBusinessMoneyMapper.updateGwjDepositBusinessMoney(gwjDepositBusinessMoney);
	}

	/**
	 * 批量删除业务维修资金分户业务金额信息（缴存业务管理模块）
	 *
	 * @param bizMoneyIds 需要删除的业务维修资金分户业务金额信息（缴存业务管理模块）主键
	 * @return 结果
	 */
	@Override
	public int deleteGwjDepositBusinessMoneyByBizMoneyIds(Long[] bizMoneyIds) {
		return gwjDepositBusinessMoneyMapper.deleteGwjDepositBusinessMoneyByBizMoneyIds(bizMoneyIds);
	}

	/**
	 * 删除业务维修资金分户业务金额信息（缴存业务管理模块）信息
	 *
	 * @param bizMoneyId 业务维修资金分户业务金额信息（缴存业务管理模块）主键
	 * @return 结果
	 */
	@Override
	public int deleteGwjDepositBusinessMoneyByBizMoneyId(Long bizMoneyId) {
		return gwjDepositBusinessMoneyMapper.deleteGwjDepositBusinessMoneyByBizMoneyId(bizMoneyId);
	}

	/**
	 * 查询业务维修资金分户业务金额信息（缴存业务管理模块）
	 *
	 * @param bizId 业务ID
	 * @return 业务维修资金分户业务金额信息（缴存业务管理模块）
	 */
	@Override
	public GwjDepositBusinessMoney selectGwjDepositBusinessMoneyByBizId(Long bizId) {
		GwjDepositBusinessMoney gwjDepositBusinessMoney = new GwjDepositBusinessMoney();
		gwjDepositBusinessMoney.setBizId(bizId);
		return gwjDepositBusinessMoneyMapper.selectGwjDepositBusinessMoney(gwjDepositBusinessMoney);
	}

	/**
	 * 根据业务ID删除业务维修资金分户业务金额信息（缴存业务管理模块）信息
	 *
	 * @param bizId 业务ID
	 * @return 结果
	 */
	@Override
	public int deleteGwjDepositBusinessMoneyByBizId(Long bizId) {
		return gwjDepositBusinessMoneyMapper.deleteGwjDepositBusinessMoneyByBizId(bizId);
	}
}
